# gozerlib/channelbase.py
#
#

""" provide a base class for channels (waves, xmpp, web). """

## gozerlib imports

from gozerlib.utils.lazydict import LazyDict

## basic imports

import time

class ChannelBase(LazyDict):

    """
        Base class for all channel objects. 

        :param name: name of the channel
        :type name: string
        :param type: type of channel
        :type type: string

    """

    def __init__(self, id, name="notset", type="notset"):
        LazyDict.__init__(self)
        self.id = id
        self.name = name
        self.type = type
        self.lastmodified = time.time()
        self.wholastmodified = "notset"

    def parse(self, event):

        """
            parse an event for channel related data and constuct the 
            channel with it. Overload this.

            :param event: event to parse
            :type event: gozerlib.eventbase.EventBase
            :rtype: self

        """

        pass

